/*
 * @Description:
 * @version:
 * @Author: m
 * @LastEditors: m
 */
const path = require("path");

function resolve(dir) {
	return path.join(__dirname, dir);
}

module.exports = {
	publicPath: "./",
	outputDir: "dist",
	assetsDir: "static",
	chainWebpack: (config) => {
		config.resolve.alias
			.set("@", resolve("./src"))
			.set("components", resolve("./src/components"))
			.set("img", resolve("./src/assets/img"));
	},

	// 是否在开发环境下通过 eslint-loader 在每次保存时 lint 代码 (在生产构建时禁用 eslint-loader)
	lintOnSave: process.env.NODE_ENV !== "production",

	// devServer: {
	// 	disableHostCheck: true,
	// },

	devServer: {
		open: true, // 设置自动打开浏览器
		port: 8849, // 设置端口
		https: false,
		hotOnly: true, // 热更新
	},
};
